package com.searchbyesandhbase.entity.doc;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * @author LJK
 * @description
 * @date 2024/10/27
 */
@Data
@Document(indexName = "article")
@AllArgsConstructor
@NoArgsConstructor
public class ArticleDoc implements Serializable {
    @Id
    @Field(type = FieldType.Keyword)
    private Integer id;
    @Field(type = FieldType.Text)
    private String title;

    @Field(type = FieldType.Text)
    private String content;

    @Field(type = FieldType.Text, index = false)
    private String author;

    @Field(type = FieldType.Date, index = false)
    private String time;

    @Field(type = FieldType.Text)
    private String describe;

    //高亮封装
    @Transient
    private Map<String, List<String>> highlights;

}
